{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import re\n",
    "my = pd.read_csv('maoyanfilms.csv')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 数据清洗"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>films_id</th>\n",
       "      <th>films_name</th>\n",
       "      <th>films_type</th>\n",
       "      <th>films_area</th>\n",
       "      <th>films_duration</th>\n",
       "      <th>film_first_time</th>\n",
       "      <th>films_score</th>\n",
       "      <th>films_comment_num</th>\n",
       "      <th>films_box_office</th>\n",
       "      <th>films_director</th>\n",
       "      <th>films_actor</th>\n",
       "      <th>films_introduction</th>\n",
       "      <th>films_comment</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>3</td>\n",
       "      <td>非诚勿扰2</td>\n",
       "      <td>喜剧 , 爱情</td>\n",
       "      <td>中国大陆</td>\n",
       "      <td>122分钟</td>\n",
       "      <td>2010-12-22大陆上映</td>\n",
       "      <td>7.4</td>\n",
       "      <td>971</td>\n",
       "      <td>4.72亿</td>\n",
       "      <td>冯小刚</td>\n",
       "      <td>葛优    ,      舒淇    ,      孙红雷    ,      姚晨</td>\n",
       "      <td>在秦奋（葛优 饰）全然做好与笑笑（舒淇 饰）白头到老的准备之时，笑笑对秦奋的感情却仅仅止步于...</td>\n",
       "      <td>感觉没有第一部好，但是相比国内其他情感类电影，我感觉还是不错。,喜欢这部片子，感觉比起第一部...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4</td>\n",
       "      <td>游龙戏凤</td>\n",
       "      <td>爱情</td>\n",
       "      <td>中国香港</td>\n",
       "      <td>117分钟</td>\n",
       "      <td>2009-01-26大陆上映</td>\n",
       "      <td>6.1</td>\n",
       "      <td>98</td>\n",
       "      <td>1.13亿</td>\n",
       "      <td>刘伟强</td>\n",
       "      <td>刘德华    ,      舒淇    ,      张涵予    ,      何韵诗</td>\n",
       "      <td>幸福是天上玻璃球的碎片，大家拼命的拾捡，却总归不会完满，爱情就是这种带点缺憾的甜蜜幸福。 程...</td>\n",
       "      <td>当年最高票房的爱情片吧,没排片也就设看成。我就感到奇怪。龙之战血战湘江都因为假排片到今天为止...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>5</td>\n",
       "      <td>爱</td>\n",
       "      <td>爱情 , 剧情</td>\n",
       "      <td>中国台湾,中国大陆</td>\n",
       "      <td>128分钟</td>\n",
       "      <td>2012-02-14大陆上映</td>\n",
       "      <td>7.8</td>\n",
       "      <td>597</td>\n",
       "      <td>1.37亿</td>\n",
       "      <td>钮承泽\\n    ,\\n      杨小波</td>\n",
       "      <td>舒淇    ,      赵薇    ,      阮经天</td>\n",
       "      <td>宜珈（ 陈意涵 饰）认为自己就像她在大学自行车队中担任为主将挡风丶在最后冲刺阶段退下让主将冲...</td>\n",
       "      <td>喜欢陈意涵和郭采洁还有彭于晏～～～,“爱，很简单，只要在一起，什么都可以。”\\n尽管爱情很清...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>7</td>\n",
       "      <td>高海拔之恋Ⅱ</td>\n",
       "      <td>爱情</td>\n",
       "      <td>中国大陆,中国香港</td>\n",
       "      <td>112分钟</td>\n",
       "      <td>2012-02-09大陆上映</td>\n",
       "      <td>7.1</td>\n",
       "      <td>112</td>\n",
       "      <td>2137万</td>\n",
       "      <td>杜琪峰</td>\n",
       "      <td>古天乐    ,      郑秀文    ,      高圆圆    ,      王宝强</td>\n",
       "      <td>电影大奖典礼上，红遍大中华娱乐圈二十年的天王巨星迈克（古天乐 饰）第三度赢得了最佳男主角的殊...</td>\n",
       "      <td>故事情节很一般，有些地方为了表达就变得很牵强，只要是明星效应起影响了,和表妹一起在北京看的，...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>12</td>\n",
       "      <td>不能说的秘密</td>\n",
       "      <td>爱情 , 音乐 , 奇幻</td>\n",
       "      <td>中国香港,中国台湾</td>\n",
       "      <td>101分钟</td>\n",
       "      <td>2007-07-31大陆上映</td>\n",
       "      <td>8.5</td>\n",
       "      <td>29235</td>\n",
       "      <td>33万</td>\n",
       "      <td>周杰伦</td>\n",
       "      <td>周杰伦    ,      桂纶镁    ,      黄秋生    ,      曾恺玹</td>\n",
       "      <td>叶湘伦 （ 周杰伦 饰）与父亲 （ 黄秋生 饰）相依为命，他的父亲是淡江艺 术中学的训导主任...</td>\n",
       "      <td>第一部让我喜欢上周杰伦的电影，拍的很棒。电影院公映时就看过很多次，后来买了碟片珍藏，后来网上...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15425</th>\n",
       "      <td>1332420</td>\n",
       "      <td>别来无恙</td>\n",
       "      <td>NaN</td>\n",
       "      <td>中国香港</td>\n",
       "      <td>13分钟</td>\n",
       "      <td>2015-12中国香港上映</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>暂无</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>女儿少小离家，一别廿年，今日携同丈夫带着小女回家，做父亲的会作何感想？嘉怡自加拿大回流香港，...</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15426</th>\n",
       "      <td>1332422</td>\n",
       "      <td>红蜻蜓</td>\n",
       "      <td>剧情 , 短片</td>\n",
       "      <td>中国大陆</td>\n",
       "      <td>20分钟</td>\n",
       "      <td>2019-06-25北京电影学院上映</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>暂无</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>八十年代末，南方山区里，八岁的小男孩王平因为父亲的一个承诺，坚信远在山外的父亲看到他放的风筝...</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15427</th>\n",
       "      <td>1332445</td>\n",
       "      <td>倒带</td>\n",
       "      <td>纪录片 , 短片</td>\n",
       "      <td>中国大陆</td>\n",
       "      <td>4分钟</td>\n",
       "      <td>2016大陆上映</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>暂无</td>\n",
       "      <td>方天宇</td>\n",
       "      <td>NaN</td>\n",
       "      <td>为了观看父母的结婚录像带，我新买了一台录像带播放机。在用播放机为录像带倒带的时候，母亲和我聊...</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15428</th>\n",
       "      <td>1332583</td>\n",
       "      <td>罪該萬死 One Night Stand</td>\n",
       "      <td>喜剧</td>\n",
       "      <td>中国香港</td>\n",
       "      <td>125分钟</td>\n",
       "      <td>2012-10-11中国香港上映</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>暂无</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>暂无剧情简介</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15429</th>\n",
       "      <td>1332598</td>\n",
       "      <td>中空之地</td>\n",
       "      <td>纪录片</td>\n",
       "      <td>中国台湾</td>\n",
       "      <td>61分钟</td>\n",
       "      <td>2018-10-25中国台湾上映</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>暂无</td>\n",
       "      <td>陈界仁</td>\n",
       "      <td>NaN</td>\n",
       "      <td>在資本與科技已徹底合流為金融／科技資本主義，並發展出比過往治理形式更具穿透力的全域式操控技術...</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>15430 rows × 13 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       films_id            films_name      films_type films_area  \\\n",
       "0             3                 非诚勿扰2        喜剧 , 爱情        中国大陆   \n",
       "1             4                  游龙戏凤             爱情        中国香港   \n",
       "2             5                     爱        爱情 , 剧情   中国台湾,中国大陆   \n",
       "3             7                高海拔之恋Ⅱ             爱情   中国大陆,中国香港   \n",
       "4            12                不能说的秘密   爱情 , 音乐 , 奇幻   中国香港,中国台湾   \n",
       "...         ...                   ...             ...        ...   \n",
       "15425   1332420                  别来无恙             NaN       中国香港   \n",
       "15426   1332422                   红蜻蜓        剧情 , 短片        中国大陆   \n",
       "15427   1332445                    倒带       纪录片 , 短片        中国大陆   \n",
       "15428   1332583  罪該萬死 One Night Stand             喜剧        中国香港   \n",
       "15429   1332598                  中空之地            纪录片        中国台湾   \n",
       "\n",
       "      films_duration     film_first_time films_score films_comment_num  \\\n",
       "0              122分钟      2010-12-22大陆上映         7.4               971   \n",
       "1              117分钟      2009-01-26大陆上映         6.1                98   \n",
       "2              128分钟      2012-02-14大陆上映         7.8               597   \n",
       "3              112分钟      2012-02-09大陆上映         7.1               112   \n",
       "4              101分钟      2007-07-31大陆上映         8.5             29235   \n",
       "...              ...                 ...         ...               ...   \n",
       "15425           13分钟       2015-12中国香港上映         NaN               NaN   \n",
       "15426           20分钟  2019-06-25北京电影学院上映         NaN               NaN   \n",
       "15427            4分钟            2016大陆上映         NaN               NaN   \n",
       "15428          125分钟    2012-10-11中国香港上映         NaN               NaN   \n",
       "15429           61分钟    2018-10-25中国台湾上映         NaN               NaN   \n",
       "\n",
       "      films_box_office         films_director  \\\n",
       "0                4.72亿                    冯小刚   \n",
       "1                1.13亿                    刘伟强   \n",
       "2                1.37亿  钮承泽\\n    ,\\n      杨小波   \n",
       "3                2137万                    杜琪峰   \n",
       "4                  33万                    周杰伦   \n",
       "...                ...                    ...   \n",
       "15425               暂无                    NaN   \n",
       "15426               暂无                    NaN   \n",
       "15427               暂无                    方天宇   \n",
       "15428               暂无                    NaN   \n",
       "15429               暂无                    陈界仁   \n",
       "\n",
       "                                         films_actor  \\\n",
       "0         葛优    ,      舒淇    ,      孙红雷    ,      姚晨   \n",
       "1       刘德华    ,      舒淇    ,      张涵予    ,      何韵诗   \n",
       "2                      舒淇    ,      赵薇    ,      阮经天   \n",
       "3      古天乐    ,      郑秀文    ,      高圆圆    ,      王宝强   \n",
       "4      周杰伦    ,      桂纶镁    ,      黄秋生    ,      曾恺玹   \n",
       "...                                              ...   \n",
       "15425                                            NaN   \n",
       "15426                                            NaN   \n",
       "15427                                            NaN   \n",
       "15428                                            NaN   \n",
       "15429                                            NaN   \n",
       "\n",
       "                                      films_introduction  \\\n",
       "0      在秦奋（葛优 饰）全然做好与笑笑（舒淇 饰）白头到老的准备之时，笑笑对秦奋的感情却仅仅止步于...   \n",
       "1      幸福是天上玻璃球的碎片，大家拼命的拾捡，却总归不会完满，爱情就是这种带点缺憾的甜蜜幸福。 程...   \n",
       "2      宜珈（ 陈意涵 饰）认为自己就像她在大学自行车队中担任为主将挡风丶在最后冲刺阶段退下让主将冲...   \n",
       "3      电影大奖典礼上，红遍大中华娱乐圈二十年的天王巨星迈克（古天乐 饰）第三度赢得了最佳男主角的殊...   \n",
       "4      叶湘伦 （ 周杰伦 饰）与父亲 （ 黄秋生 饰）相依为命，他的父亲是淡江艺 术中学的训导主任...   \n",
       "...                                                  ...   \n",
       "15425  女儿少小离家，一别廿年，今日携同丈夫带着小女回家，做父亲的会作何感想？嘉怡自加拿大回流香港，...   \n",
       "15426  八十年代末，南方山区里，八岁的小男孩王平因为父亲的一个承诺，坚信远在山外的父亲看到他放的风筝...   \n",
       "15427  为了观看父母的结婚录像带，我新买了一台录像带播放机。在用播放机为录像带倒带的时候，母亲和我聊...   \n",
       "15428                                             暂无剧情简介   \n",
       "15429  在資本與科技已徹底合流為金融／科技資本主義，並發展出比過往治理形式更具穿透力的全域式操控技術...   \n",
       "\n",
       "                                           films_comment  \n",
       "0      感觉没有第一部好，但是相比国内其他情感类电影，我感觉还是不错。,喜欢这部片子，感觉比起第一部...  \n",
       "1      当年最高票房的爱情片吧,没排片也就设看成。我就感到奇怪。龙之战血战湘江都因为假排片到今天为止...  \n",
       "2      喜欢陈意涵和郭采洁还有彭于晏～～～,“爱，很简单，只要在一起，什么都可以。”\\n尽管爱情很清...  \n",
       "3      故事情节很一般，有些地方为了表达就变得很牵强，只要是明星效应起影响了,和表妹一起在北京看的，...  \n",
       "4      第一部让我喜欢上周杰伦的电影，拍的很棒。电影院公映时就看过很多次，后来买了碟片珍藏，后来网上...  \n",
       "...                                                  ...  \n",
       "15425                                                NaN  \n",
       "15426                                                NaN  \n",
       "15427                                                NaN  \n",
       "15428                                                NaN  \n",
       "15429                                                NaN  \n",
       "\n",
       "[15430 rows x 13 columns]"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    " my"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 首映时间的处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 去掉后面的中文\n",
    "def handle_film_first_time(x):\n",
    "    pattern = re.compile(r'[\\u4e00-\\u9fa5]')\n",
    "    date = re.sub(pattern,\"\",str(x))\n",
    "    return date\n",
    "my['film_first_time'] = my['film_first_time'].apply(handle_film_first_time)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 评分、评论数、票房 异常数据处理\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 评分、评论数 中含有异常数据 “. 2.”等\n",
    "score_list = []\n",
    "for i in range(0,10):\n",
    "    for  j in range(0,10):\n",
    "        num = str(i)+\".\"+str(j)\n",
    "        score_list.append(num)\n",
    "series_a = my[~my['films_score'].isin(score_list)]['films_score']\n",
    "series_b = series_a.dropna()\n",
    "list_a = series_b.index\n",
    "for index in list_a:\n",
    "    my.loc[index,'films_score']= np.nan\n",
    "    my.loc[index,'films_comment_num'] = np.nan\n",
    "    my.loc[index,'films_box_office'] = '暂无'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 演员、导演名字处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 去掉演员、导演名字之间的空格\n",
    "def remove_space(x):\n",
    "    s = str(x).replace(' ', '')\n",
    "    return s\n",
    "my['films_actor'] = my['films_actor'].apply(remove_space)\n",
    "my['films_director'] = my['films_director'].apply(remove_space)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>films_id</th>\n",
       "      <th>films_name</th>\n",
       "      <th>films_type</th>\n",
       "      <th>films_area</th>\n",
       "      <th>films_duration</th>\n",
       "      <th>film_first_time</th>\n",
       "      <th>films_score</th>\n",
       "      <th>films_comment_num</th>\n",
       "      <th>films_box_office</th>\n",
       "      <th>films_director</th>\n",
       "      <th>films_actor</th>\n",
       "      <th>films_introduction</th>\n",
       "      <th>films_comment</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>3</td>\n",
       "      <td>非诚勿扰2</td>\n",
       "      <td>喜剧 , 爱情</td>\n",
       "      <td>中国大陆</td>\n",
       "      <td>122分钟</td>\n",
       "      <td>2010-12-22</td>\n",
       "      <td>7.4</td>\n",
       "      <td>971</td>\n",
       "      <td>4.72亿</td>\n",
       "      <td>冯小刚</td>\n",
       "      <td>葛优,舒淇,孙红雷,姚晨</td>\n",
       "      <td>在秦奋（葛优 饰）全然做好与笑笑（舒淇 饰）白头到老的准备之时，笑笑对秦奋的感情却仅仅止步于...</td>\n",
       "      <td>感觉没有第一部好，但是相比国内其他情感类电影，我感觉还是不错。,喜欢这部片子，感觉比起第一部...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4</td>\n",
       "      <td>游龙戏凤</td>\n",
       "      <td>爱情</td>\n",
       "      <td>中国香港</td>\n",
       "      <td>117分钟</td>\n",
       "      <td>2009-01-26</td>\n",
       "      <td>6.1</td>\n",
       "      <td>98</td>\n",
       "      <td>1.13亿</td>\n",
       "      <td>刘伟强</td>\n",
       "      <td>刘德华,舒淇,张涵予,何韵诗</td>\n",
       "      <td>幸福是天上玻璃球的碎片，大家拼命的拾捡，却总归不会完满，爱情就是这种带点缺憾的甜蜜幸福。 程...</td>\n",
       "      <td>当年最高票房的爱情片吧,没排片也就设看成。我就感到奇怪。龙之战血战湘江都因为假排片到今天为止...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>5</td>\n",
       "      <td>爱</td>\n",
       "      <td>爱情 , 剧情</td>\n",
       "      <td>中国台湾,中国大陆</td>\n",
       "      <td>128分钟</td>\n",
       "      <td>2012-02-14</td>\n",
       "      <td>7.8</td>\n",
       "      <td>597</td>\n",
       "      <td>1.37亿</td>\n",
       "      <td>钮承泽\\n,\\n杨小波</td>\n",
       "      <td>舒淇,赵薇,阮经天</td>\n",
       "      <td>宜珈（ 陈意涵 饰）认为自己就像她在大学自行车队中担任为主将挡风丶在最后冲刺阶段退下让主将冲...</td>\n",
       "      <td>喜欢陈意涵和郭采洁还有彭于晏～～～,“爱，很简单，只要在一起，什么都可以。”\\n尽管爱情很清...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>7</td>\n",
       "      <td>高海拔之恋Ⅱ</td>\n",
       "      <td>爱情</td>\n",
       "      <td>中国大陆,中国香港</td>\n",
       "      <td>112分钟</td>\n",
       "      <td>2012-02-09</td>\n",
       "      <td>7.1</td>\n",
       "      <td>112</td>\n",
       "      <td>2137万</td>\n",
       "      <td>杜琪峰</td>\n",
       "      <td>古天乐,郑秀文,高圆圆,王宝强</td>\n",
       "      <td>电影大奖典礼上，红遍大中华娱乐圈二十年的天王巨星迈克（古天乐 饰）第三度赢得了最佳男主角的殊...</td>\n",
       "      <td>故事情节很一般，有些地方为了表达就变得很牵强，只要是明星效应起影响了,和表妹一起在北京看的，...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>12</td>\n",
       "      <td>不能说的秘密</td>\n",
       "      <td>爱情 , 音乐 , 奇幻</td>\n",
       "      <td>中国香港,中国台湾</td>\n",
       "      <td>101分钟</td>\n",
       "      <td>2007-07-31</td>\n",
       "      <td>8.5</td>\n",
       "      <td>29235</td>\n",
       "      <td>33万</td>\n",
       "      <td>周杰伦</td>\n",
       "      <td>周杰伦,桂纶镁,黄秋生,曾恺玹</td>\n",
       "      <td>叶湘伦 （ 周杰伦 饰）与父亲 （ 黄秋生 饰）相依为命，他的父亲是淡江艺 术中学的训导主任...</td>\n",
       "      <td>第一部让我喜欢上周杰伦的电影，拍的很棒。电影院公映时就看过很多次，后来买了碟片珍藏，后来网上...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15425</th>\n",
       "      <td>1332420</td>\n",
       "      <td>别来无恙</td>\n",
       "      <td>NaN</td>\n",
       "      <td>中国香港</td>\n",
       "      <td>13分钟</td>\n",
       "      <td>2015-12</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>暂无</td>\n",
       "      <td>nan</td>\n",
       "      <td>nan</td>\n",
       "      <td>女儿少小离家，一别廿年，今日携同丈夫带着小女回家，做父亲的会作何感想？嘉怡自加拿大回流香港，...</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15426</th>\n",
       "      <td>1332422</td>\n",
       "      <td>红蜻蜓</td>\n",
       "      <td>剧情 , 短片</td>\n",
       "      <td>中国大陆</td>\n",
       "      <td>20分钟</td>\n",
       "      <td>2019-06-25</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>暂无</td>\n",
       "      <td>nan</td>\n",
       "      <td>nan</td>\n",
       "      <td>八十年代末，南方山区里，八岁的小男孩王平因为父亲的一个承诺，坚信远在山外的父亲看到他放的风筝...</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15427</th>\n",
       "      <td>1332445</td>\n",
       "      <td>倒带</td>\n",
       "      <td>纪录片 , 短片</td>\n",
       "      <td>中国大陆</td>\n",
       "      <td>4分钟</td>\n",
       "      <td>2016</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>暂无</td>\n",
       "      <td>方天宇</td>\n",
       "      <td>nan</td>\n",
       "      <td>为了观看父母的结婚录像带，我新买了一台录像带播放机。在用播放机为录像带倒带的时候，母亲和我聊...</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15428</th>\n",
       "      <td>1332583</td>\n",
       "      <td>罪該萬死 One Night Stand</td>\n",
       "      <td>喜剧</td>\n",
       "      <td>中国香港</td>\n",
       "      <td>125分钟</td>\n",
       "      <td>2012-10-11</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>暂无</td>\n",
       "      <td>nan</td>\n",
       "      <td>nan</td>\n",
       "      <td>暂无剧情简介</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15429</th>\n",
       "      <td>1332598</td>\n",
       "      <td>中空之地</td>\n",
       "      <td>纪录片</td>\n",
       "      <td>中国台湾</td>\n",
       "      <td>61分钟</td>\n",
       "      <td>2018-10-25</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>暂无</td>\n",
       "      <td>陈界仁</td>\n",
       "      <td>nan</td>\n",
       "      <td>在資本與科技已徹底合流為金融／科技資本主義，並發展出比過往治理形式更具穿透力的全域式操控技術...</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>15430 rows × 13 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       films_id            films_name      films_type films_area  \\\n",
       "0             3                 非诚勿扰2        喜剧 , 爱情        中国大陆   \n",
       "1             4                  游龙戏凤             爱情        中国香港   \n",
       "2             5                     爱        爱情 , 剧情   中国台湾,中国大陆   \n",
       "3             7                高海拔之恋Ⅱ             爱情   中国大陆,中国香港   \n",
       "4            12                不能说的秘密   爱情 , 音乐 , 奇幻   中国香港,中国台湾   \n",
       "...         ...                   ...             ...        ...   \n",
       "15425   1332420                  别来无恙             NaN       中国香港   \n",
       "15426   1332422                   红蜻蜓        剧情 , 短片        中国大陆   \n",
       "15427   1332445                    倒带       纪录片 , 短片        中国大陆   \n",
       "15428   1332583  罪該萬死 One Night Stand             喜剧        中国香港   \n",
       "15429   1332598                  中空之地            纪录片        中国台湾   \n",
       "\n",
       "      films_duration film_first_time films_score films_comment_num  \\\n",
       "0              122分钟      2010-12-22         7.4               971   \n",
       "1              117分钟      2009-01-26         6.1                98   \n",
       "2              128分钟      2012-02-14         7.8               597   \n",
       "3              112分钟      2012-02-09         7.1               112   \n",
       "4              101分钟      2007-07-31         8.5             29235   \n",
       "...              ...             ...         ...               ...   \n",
       "15425           13分钟         2015-12         NaN               NaN   \n",
       "15426           20分钟      2019-06-25         NaN               NaN   \n",
       "15427            4分钟            2016         NaN               NaN   \n",
       "15428          125分钟      2012-10-11         NaN               NaN   \n",
       "15429           61分钟      2018-10-25         NaN               NaN   \n",
       "\n",
       "      films_box_office films_director      films_actor  \\\n",
       "0                4.72亿            冯小刚     葛优,舒淇,孙红雷,姚晨   \n",
       "1                1.13亿            刘伟强   刘德华,舒淇,张涵予,何韵诗   \n",
       "2                1.37亿    钮承泽\\n,\\n杨小波        舒淇,赵薇,阮经天   \n",
       "3                2137万            杜琪峰  古天乐,郑秀文,高圆圆,王宝强   \n",
       "4                  33万            周杰伦  周杰伦,桂纶镁,黄秋生,曾恺玹   \n",
       "...                ...            ...              ...   \n",
       "15425               暂无            nan              nan   \n",
       "15426               暂无            nan              nan   \n",
       "15427               暂无            方天宇              nan   \n",
       "15428               暂无            nan              nan   \n",
       "15429               暂无            陈界仁              nan   \n",
       "\n",
       "                                      films_introduction  \\\n",
       "0      在秦奋（葛优 饰）全然做好与笑笑（舒淇 饰）白头到老的准备之时，笑笑对秦奋的感情却仅仅止步于...   \n",
       "1      幸福是天上玻璃球的碎片，大家拼命的拾捡，却总归不会完满，爱情就是这种带点缺憾的甜蜜幸福。 程...   \n",
       "2      宜珈（ 陈意涵 饰）认为自己就像她在大学自行车队中担任为主将挡风丶在最后冲刺阶段退下让主将冲...   \n",
       "3      电影大奖典礼上，红遍大中华娱乐圈二十年的天王巨星迈克（古天乐 饰）第三度赢得了最佳男主角的殊...   \n",
       "4      叶湘伦 （ 周杰伦 饰）与父亲 （ 黄秋生 饰）相依为命，他的父亲是淡江艺 术中学的训导主任...   \n",
       "...                                                  ...   \n",
       "15425  女儿少小离家，一别廿年，今日携同丈夫带着小女回家，做父亲的会作何感想？嘉怡自加拿大回流香港，...   \n",
       "15426  八十年代末，南方山区里，八岁的小男孩王平因为父亲的一个承诺，坚信远在山外的父亲看到他放的风筝...   \n",
       "15427  为了观看父母的结婚录像带，我新买了一台录像带播放机。在用播放机为录像带倒带的时候，母亲和我聊...   \n",
       "15428                                             暂无剧情简介   \n",
       "15429  在資本與科技已徹底合流為金融／科技資本主義，並發展出比過往治理形式更具穿透力的全域式操控技術...   \n",
       "\n",
       "                                           films_comment  \n",
       "0      感觉没有第一部好，但是相比国内其他情感类电影，我感觉还是不错。,喜欢这部片子，感觉比起第一部...  \n",
       "1      当年最高票房的爱情片吧,没排片也就设看成。我就感到奇怪。龙之战血战湘江都因为假排片到今天为止...  \n",
       "2      喜欢陈意涵和郭采洁还有彭于晏～～～,“爱，很简单，只要在一起，什么都可以。”\\n尽管爱情很清...  \n",
       "3      故事情节很一般，有些地方为了表达就变得很牵强，只要是明星效应起影响了,和表妹一起在北京看的，...  \n",
       "4      第一部让我喜欢上周杰伦的电影，拍的很棒。电影院公映时就看过很多次，后来买了碟片珍藏，后来网上...  \n",
       "...                                                  ...  \n",
       "15425                                                NaN  \n",
       "15426                                                NaN  \n",
       "15427                                                NaN  \n",
       "15428                                                NaN  \n",
       "15429                                                NaN  \n",
       "\n",
       "[15430 rows x 13 columns]"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    " my"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 票房处理 （单位万）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "def handle_films_box_office\t(x):\n",
    "    s = x[-1:]\n",
    "    if s =='亿':\n",
    "        return int(float(x[0:len(x)-1])*10000)\n",
    "    elif s =='万':\n",
    "        try:\n",
    "            f = float(x[0:len(x)-1])\n",
    "        except:\n",
    "            return np.nan\n",
    "        else:          \n",
    "            return f\n",
    "    else:\n",
    "        return np.nan\n",
    "my['films_box_office']= my['films_box_office'].apply(handle_films_box_office)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>films_id</th>\n",
       "      <th>films_name</th>\n",
       "      <th>films_type</th>\n",
       "      <th>films_area</th>\n",
       "      <th>films_duration</th>\n",
       "      <th>film_first_time</th>\n",
       "      <th>films_score</th>\n",
       "      <th>films_comment_num</th>\n",
       "      <th>films_box_office</th>\n",
       "      <th>films_director</th>\n",
       "      <th>films_actor</th>\n",
       "      <th>films_introduction</th>\n",
       "      <th>films_comment</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>3</td>\n",
       "      <td>非诚勿扰2</td>\n",
       "      <td>喜剧 , 爱情</td>\n",
       "      <td>中国大陆</td>\n",
       "      <td>122分钟</td>\n",
       "      <td>2010-12-22</td>\n",
       "      <td>7.4</td>\n",
       "      <td>971</td>\n",
       "      <td>47200.0</td>\n",
       "      <td>冯小刚</td>\n",
       "      <td>葛优,舒淇,孙红雷,姚晨</td>\n",
       "      <td>在秦奋（葛优 饰）全然做好与笑笑（舒淇 饰）白头到老的准备之时，笑笑对秦奋的感情却仅仅止步于...</td>\n",
       "      <td>感觉没有第一部好，但是相比国内其他情感类电影，我感觉还是不错。,喜欢这部片子，感觉比起第一部...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4</td>\n",
       "      <td>游龙戏凤</td>\n",
       "      <td>爱情</td>\n",
       "      <td>中国香港</td>\n",
       "      <td>117分钟</td>\n",
       "      <td>2009-01-26</td>\n",
       "      <td>6.1</td>\n",
       "      <td>98</td>\n",
       "      <td>11299.0</td>\n",
       "      <td>刘伟强</td>\n",
       "      <td>刘德华,舒淇,张涵予,何韵诗</td>\n",
       "      <td>幸福是天上玻璃球的碎片，大家拼命的拾捡，却总归不会完满，爱情就是这种带点缺憾的甜蜜幸福。 程...</td>\n",
       "      <td>当年最高票房的爱情片吧,没排片也就设看成。我就感到奇怪。龙之战血战湘江都因为假排片到今天为止...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>5</td>\n",
       "      <td>爱</td>\n",
       "      <td>爱情 , 剧情</td>\n",
       "      <td>中国台湾,中国大陆</td>\n",
       "      <td>128分钟</td>\n",
       "      <td>2012-02-14</td>\n",
       "      <td>7.8</td>\n",
       "      <td>597</td>\n",
       "      <td>13700.0</td>\n",
       "      <td>钮承泽\\n,\\n杨小波</td>\n",
       "      <td>舒淇,赵薇,阮经天</td>\n",
       "      <td>宜珈（ 陈意涵 饰）认为自己就像她在大学自行车队中担任为主将挡风丶在最后冲刺阶段退下让主将冲...</td>\n",
       "      <td>喜欢陈意涵和郭采洁还有彭于晏～～～,“爱，很简单，只要在一起，什么都可以。”\\n尽管爱情很清...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>7</td>\n",
       "      <td>高海拔之恋Ⅱ</td>\n",
       "      <td>爱情</td>\n",
       "      <td>中国大陆,中国香港</td>\n",
       "      <td>112分钟</td>\n",
       "      <td>2012-02-09</td>\n",
       "      <td>7.1</td>\n",
       "      <td>112</td>\n",
       "      <td>2137.0</td>\n",
       "      <td>杜琪峰</td>\n",
       "      <td>古天乐,郑秀文,高圆圆,王宝强</td>\n",
       "      <td>电影大奖典礼上，红遍大中华娱乐圈二十年的天王巨星迈克（古天乐 饰）第三度赢得了最佳男主角的殊...</td>\n",
       "      <td>故事情节很一般，有些地方为了表达就变得很牵强，只要是明星效应起影响了,和表妹一起在北京看的，...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>12</td>\n",
       "      <td>不能说的秘密</td>\n",
       "      <td>爱情 , 音乐 , 奇幻</td>\n",
       "      <td>中国香港,中国台湾</td>\n",
       "      <td>101分钟</td>\n",
       "      <td>2007-07-31</td>\n",
       "      <td>8.5</td>\n",
       "      <td>29235</td>\n",
       "      <td>33.0</td>\n",
       "      <td>周杰伦</td>\n",
       "      <td>周杰伦,桂纶镁,黄秋生,曾恺玹</td>\n",
       "      <td>叶湘伦 （ 周杰伦 饰）与父亲 （ 黄秋生 饰）相依为命，他的父亲是淡江艺 术中学的训导主任...</td>\n",
       "      <td>第一部让我喜欢上周杰伦的电影，拍的很棒。电影院公映时就看过很多次，后来买了碟片珍藏，后来网上...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15425</th>\n",
       "      <td>1332420</td>\n",
       "      <td>别来无恙</td>\n",
       "      <td>NaN</td>\n",
       "      <td>中国香港</td>\n",
       "      <td>13分钟</td>\n",
       "      <td>2015-12</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>nan</td>\n",
       "      <td>女儿少小离家，一别廿年，今日携同丈夫带着小女回家，做父亲的会作何感想？嘉怡自加拿大回流香港，...</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15426</th>\n",
       "      <td>1332422</td>\n",
       "      <td>红蜻蜓</td>\n",
       "      <td>剧情 , 短片</td>\n",
       "      <td>中国大陆</td>\n",
       "      <td>20分钟</td>\n",
       "      <td>2019-06-25</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>nan</td>\n",
       "      <td>八十年代末，南方山区里，八岁的小男孩王平因为父亲的一个承诺，坚信远在山外的父亲看到他放的风筝...</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15427</th>\n",
       "      <td>1332445</td>\n",
       "      <td>倒带</td>\n",
       "      <td>纪录片 , 短片</td>\n",
       "      <td>中国大陆</td>\n",
       "      <td>4分钟</td>\n",
       "      <td>2016</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>方天宇</td>\n",
       "      <td>nan</td>\n",
       "      <td>为了观看父母的结婚录像带，我新买了一台录像带播放机。在用播放机为录像带倒带的时候，母亲和我聊...</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15428</th>\n",
       "      <td>1332583</td>\n",
       "      <td>罪該萬死 One Night Stand</td>\n",
       "      <td>喜剧</td>\n",
       "      <td>中国香港</td>\n",
       "      <td>125分钟</td>\n",
       "      <td>2012-10-11</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>nan</td>\n",
       "      <td>暂无剧情简介</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15429</th>\n",
       "      <td>1332598</td>\n",
       "      <td>中空之地</td>\n",
       "      <td>纪录片</td>\n",
       "      <td>中国台湾</td>\n",
       "      <td>61分钟</td>\n",
       "      <td>2018-10-25</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>陈界仁</td>\n",
       "      <td>nan</td>\n",
       "      <td>在資本與科技已徹底合流為金融／科技資本主義，並發展出比過往治理形式更具穿透力的全域式操控技術...</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>15430 rows × 13 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       films_id            films_name      films_type films_area  \\\n",
       "0             3                 非诚勿扰2        喜剧 , 爱情        中国大陆   \n",
       "1             4                  游龙戏凤             爱情        中国香港   \n",
       "2             5                     爱        爱情 , 剧情   中国台湾,中国大陆   \n",
       "3             7                高海拔之恋Ⅱ             爱情   中国大陆,中国香港   \n",
       "4            12                不能说的秘密   爱情 , 音乐 , 奇幻   中国香港,中国台湾   \n",
       "...         ...                   ...             ...        ...   \n",
       "15425   1332420                  别来无恙             NaN       中国香港   \n",
       "15426   1332422                   红蜻蜓        剧情 , 短片        中国大陆   \n",
       "15427   1332445                    倒带       纪录片 , 短片        中国大陆   \n",
       "15428   1332583  罪該萬死 One Night Stand             喜剧        中国香港   \n",
       "15429   1332598                  中空之地            纪录片        中国台湾   \n",
       "\n",
       "      films_duration film_first_time films_score films_comment_num  \\\n",
       "0              122分钟      2010-12-22         7.4               971   \n",
       "1              117分钟      2009-01-26         6.1                98   \n",
       "2              128分钟      2012-02-14         7.8               597   \n",
       "3              112分钟      2012-02-09         7.1               112   \n",
       "4              101分钟      2007-07-31         8.5             29235   \n",
       "...              ...             ...         ...               ...   \n",
       "15425           13分钟         2015-12         NaN               NaN   \n",
       "15426           20分钟      2019-06-25         NaN               NaN   \n",
       "15427            4分钟            2016         NaN               NaN   \n",
       "15428          125分钟      2012-10-11         NaN               NaN   \n",
       "15429           61分钟      2018-10-25         NaN               NaN   \n",
       "\n",
       "       films_box_office films_director      films_actor  \\\n",
       "0               47200.0            冯小刚     葛优,舒淇,孙红雷,姚晨   \n",
       "1               11299.0            刘伟强   刘德华,舒淇,张涵予,何韵诗   \n",
       "2               13700.0    钮承泽\\n,\\n杨小波        舒淇,赵薇,阮经天   \n",
       "3                2137.0            杜琪峰  古天乐,郑秀文,高圆圆,王宝强   \n",
       "4                  33.0            周杰伦  周杰伦,桂纶镁,黄秋生,曾恺玹   \n",
       "...                 ...            ...              ...   \n",
       "15425               NaN            nan              nan   \n",
       "15426               NaN            nan              nan   \n",
       "15427               NaN            方天宇              nan   \n",
       "15428               NaN            nan              nan   \n",
       "15429               NaN            陈界仁              nan   \n",
       "\n",
       "                                      films_introduction  \\\n",
       "0      在秦奋（葛优 饰）全然做好与笑笑（舒淇 饰）白头到老的准备之时，笑笑对秦奋的感情却仅仅止步于...   \n",
       "1      幸福是天上玻璃球的碎片，大家拼命的拾捡，却总归不会完满，爱情就是这种带点缺憾的甜蜜幸福。 程...   \n",
       "2      宜珈（ 陈意涵 饰）认为自己就像她在大学自行车队中担任为主将挡风丶在最后冲刺阶段退下让主将冲...   \n",
       "3      电影大奖典礼上，红遍大中华娱乐圈二十年的天王巨星迈克（古天乐 饰）第三度赢得了最佳男主角的殊...   \n",
       "4      叶湘伦 （ 周杰伦 饰）与父亲 （ 黄秋生 饰）相依为命，他的父亲是淡江艺 术中学的训导主任...   \n",
       "...                                                  ...   \n",
       "15425  女儿少小离家，一别廿年，今日携同丈夫带着小女回家，做父亲的会作何感想？嘉怡自加拿大回流香港，...   \n",
       "15426  八十年代末，南方山区里，八岁的小男孩王平因为父亲的一个承诺，坚信远在山外的父亲看到他放的风筝...   \n",
       "15427  为了观看父母的结婚录像带，我新买了一台录像带播放机。在用播放机为录像带倒带的时候，母亲和我聊...   \n",
       "15428                                             暂无剧情简介   \n",
       "15429  在資本與科技已徹底合流為金融／科技資本主義，並發展出比過往治理形式更具穿透力的全域式操控技術...   \n",
       "\n",
       "                                           films_comment  \n",
       "0      感觉没有第一部好，但是相比国内其他情感类电影，我感觉还是不错。,喜欢这部片子，感觉比起第一部...  \n",
       "1      当年最高票房的爱情片吧,没排片也就设看成。我就感到奇怪。龙之战血战湘江都因为假排片到今天为止...  \n",
       "2      喜欢陈意涵和郭采洁还有彭于晏～～～,“爱，很简单，只要在一起，什么都可以。”\\n尽管爱情很清...  \n",
       "3      故事情节很一般，有些地方为了表达就变得很牵强，只要是明星效应起影响了,和表妹一起在北京看的，...  \n",
       "4      第一部让我喜欢上周杰伦的电影，拍的很棒。电影院公映时就看过很多次，后来买了碟片珍藏，后来网上...  \n",
       "...                                                  ...  \n",
       "15425                                                NaN  \n",
       "15426                                                NaN  \n",
       "15427                                                NaN  \n",
       "15428                                                NaN  \n",
       "15429                                                NaN  \n",
       "\n",
       "[15430 rows x 13 columns]"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "my"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 写入新的csv文件"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "my.to_csv('maoyanfilms_clean.csv')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
